package com.adaxi.adc.business.manager.controller;

import com.adaxi.adc.business.manager.pojo.Passenger;
import com.adaxi.adc.business.manager.pojo.Vehicle;
import com.adaxi.adc.business.manager.service.PassengerService;
import com.adaxi.adc.business.manager.service.VehicleService;
import com.adaxi.adc.common.common.CommonResult;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "用户接口", value = "PassengerController")
@RestController
public class UserController {
   @Autowired
    PassengerService passengerService;
   @Autowired
    VehicleService vehicleService;


    @ApiOperation("用户列表查询")
    @GetMapping("/user")
    public CommonResult queryPage(@RequestParam(value = "pageNum",defaultValue = "1",required = false) Integer pageNum,
                                  @RequestParam(value = "pageSize",defaultValue = "5",required = false) Integer pageSize){
        IPage<Passenger> page  =new Page(pageNum,pageSize);
        passengerService.queryPage(page);
        return  CommonResult.SUCCESS("用户查询成功",page);
    }
}
